PHP implements escape and unescape function code sharing in Javascript. PHP implementation of escape in Javascript and unescape function code sharing this article mainly introduces PHP implementation of escape and unescape function code sharing,
The CHR function is used to convert an ASCII code to a character, the Ord function is used to convert a character to ASCII ASCII code that is the computer can display the character encoding, its value range is 0-255, including punctuation, letters,
Some people brushed N more DedeCMS holes a year ago. I personally said that they were speechless and roughly looked at them. These holes had too many limitations. one sentence: as long as the GPC was opened, they could not be used... ask which idiot
UTF code
The UTF-8 is to encode the UCS in 8-bit units. The encoding method from UCS-2 to UTF-8 is as follows:
UCS-2 encoding (16-in-system)
UTF-8 byte stream (binary)
0000-007f
0xxxxxxx
0080-07ff
110xxxxx 10xxxxxx
0800-ffff
1110xxxx 10xxxxxx
Phputf-8 to unicode functions page 12th. The UTF encoding UTF-8 is coded in 8 bits. The encoding method from UCS-2 to UTF-8 is as follows: UCS-2 encoding (hexadecimal) UTF-8 byte stream (binary) bytes -007f0xxxxxxx0080-07ff UTF encoding
The UTF-8 is
Php, we want to convert the uft-8 to unicode, you can use the following function to implement UTF encoding
The UTF-8 is coded in 8 bits. The encoding from UCS-2 to UTF-8 is as follows:
UCS-2 coding (hexadecimal)
UTF-8 byte stream (binary)
0000-007F
0
UTF encoding
The UTF-8 is to encode the UCS as a 8-bit unit. The encoding from UCS-2 to UTF-8 is as follows:
UCS-2 encoding (16 binary)
UTF-8 byte stream (binary)
0000-007f
0xxxxxxx
0080-07ff
110xxxxx 10xxxxxx
0800-ffff
1110xxxx 10xxxxxx
Encoding conversion between gb2312 and unicodeThe following example converts gb2312 to "full ".The iconv function after php4.3.1 is very useful, but you only need to write a conversion function from uft8 to unicode.Check the table (gb2312.txt ).Copy
encoding conversion between gb2312 and Unicode
The following example converts a gb2312 into a "full" form
php4.3.1 after the Iconv function is very useful, just need to write a uft8 to Unicode conversion function
Tabular (gb2312.txt) is OK
Copy
Coding | conversion
encoding conversion between gb2312 and Unicode
The following example is to convert gb2312 to "whole" in this form
php4.3.1 later Iconv function is very useful, just need to write a uft8 to Unicode conversion functionTabular (gb231
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.